package cn.tedu.scalaoop

/**
 * @author Amos
 * @date 2022/5/17
 */

// 单例对象，属性和方法都是静态对象
object ObjTest {

  val name = "赵云"
  var age = 20
  var address = "北京西城"

  def sayHi()={
    println("hello")
  }

  def main(args: Array[String]): Unit = {
    println(name,age,address)
  }
}

object ObjTest1 {
  def main(args: Array[String]): Unit = {
    ObjTest.sayHi()
    println(ObjTest.name,ObjTest.address)
  }
}
